package com.study.seckill.util;

import java.io.FileWriter;
import java.io.IOException;

/**
 * @ClassName: AlipayConfig
 * @Author: wYin
 * @Date: 2022/3/16 14:42
 */
public class AlipayConfig {

//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "2021000118663060";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCaRcBH+jx5TlukoL+d5z/3RaowCLD65cZMYsMB7U9uxT/neb6KeiV3lzjAA1qg0tuWotkuLzWmZNt2c835zsHvpowu0mhdzcMlMiuc8iM4Hpt3yHBWqqWSJpJjbiu4wIFhMbFd1CIvVzwxHEVk4bTniy3Qzxp/zTX7CaaoaK9TR3+V6XWawb1gjAmXOUuDL00IbWBixajY80E8lHhPjN0NpJgyloZCOw/Trd0x32SHBfaxemHPnX4PazUa2AaRZ4GOYY3/s6mBaafaeO6wS+zN5TQ3g8KZcDEYBepPaMbqBXRbxxLKGbsG+xgH87315BE34Xvz5rtZz4QDK8LQ1/dvAgMBAAECggEAWsFR3oYNcWdxbiXK0/+ol7T564wRYWgvAdzPz6BlrEqJz4jFWP2GcRYbIopWlGm3GKTwksTfEOYgXUy/DYheerdFnH3XO+fCN22OTqP7qBYJa6wUukdlY9chIzE6s1M8SYtMRmB3Q9ZT6KgzAqftHpG4ADD1690zNl11F3mOOrTVsZxsZVfUNs+ocS/+eVFQjEd271RTG/c1B3DxQhhWU11G9dPo4ZbKoQKGfXXby5cOg06nrpuY5MMGFd3LmiUNmNcnjhI0YqqD7xLawjazKG+HwG9sCvQuoX7acQpxRn21mEmntsNL/XvPUALU7USZ/4KHbP3x/bMd8DtuoVQUoQKBgQDsfUPc/08O3SIgJ9iI98Y39zJsPbarT+2xDlwjQSDVS2b7pGB8EBfSWAzwMkYaDiyfPOit2Eou+UPEahbfjojhuhjad6cHqlZPb0FRHve10HDynUXExcwEJpfCaiHNkXqHpAwSZxQwvgL7GvRiRdTjwW4Gd8s1jMeN9OOj/PrrmQKBgQCnAAnBIFOwXkiSD1H+p55nFnZp7wpF5X0hYW2e3C+oAurSR4P2bNZ3c6ck6Fs5iyt6a1u56D55zmA09steSITus0cr5Na9FccxhjJ2xP33AyxbUB5GiFrmG/urMkhTk+lOO7nizy5fFGvX80PFV+VgdRsxfnZWrBo5Qd2fLKmgRwKBgFxpzv0rX6+FRnKeX4WWnYT9Ol0F+L4VK+NGo0a7iqMPJh0r7PBOMaDm+5dZbf98jn9jg+F7ZfHZQlwcwPd3cZIT8OZeX40lSTkdVr7mhRItdBW606rDSKhOlHtKkg8MzH744ibG1SL+/Zc2v00v0LN3wRER+vzgGJMmoVZR45PxAoGBAJK6t9dV/fIihQTALTzgLY9J7zTYcGBFaJIhtl0z/TNTjNrBNzMXIcDGfv8woKaInuTq2ycW5X3EVEd05+6pLRNFtazdXce5ENF0pXYxUyrrQNfiJxe1ypgP0iny/hVhCkZQt9yOSKIFoVOWS99igQklG4V7JaK1iDzyoDSw20EVAoGAOPo05l9knNG+2WAL5IgeWEJZMHqZqIHlw2pgLYP7HjowwgKFNqQgy8nzRkYaLTPkDKj30LHzUBXRYVucrFOWPoZtcOtt9c2xnPGq2oQJEVRrpmFvlfF4Mn1Q7XzIloBD5yPyfDulEqe4O1h//09GYOXrIoN8FqBXSWkjUIOjWuY=";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAg84ymD5Jbx/ZINXSl0pykzexmfCJd5UIkQr8nuPtGbSGszUwhVEu4m2kUjahhImwnrWOjkc/lp+CjI8eE4dKp/QuMgKCQFTEslTzh5JeCVGJN1JIIYntyaqy1Rpgynmti7XDrFBRt2u2vQZNG1vGeHIJEnUM1FWxrDxbVhlKT5zhKcke/mep6k5eI3MIpNocSWkfEUm0ZOlW+XS/GSsCF8mmOrfop423A8xyWqlc86FmEhp4dQ64waJjHbvIEKXTqep4txv43ozO6ifz7J+yL/MatS65xWqS9uakDzT+DBB74g+kRrc5Qn/QxbIcNHd8VMa/ztZl0jY82ZiqxWV2uwIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "http://localhost:8081/result";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "http://localhost:8081/result";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    // 支付宝网关
    public static String log_path = "C:\\";

//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}